const express = require('express');
const router = express.Router();
const orderCtrl = require('../controllers/orderCtrl');
const auth = require('../middleware/auth');

// 获取订单列表
router.get('/list', auth, orderCtrl.getOrders);

// 获取订单详情
router.get('/detail/:id', auth, orderCtrl.getOrderDetail);

// 创建订单
router.post('/create', auth, orderCtrl.createOrder);

// 更新订单状态
router.patch('/status/:id', auth, orderCtrl.updateOrderStatus);

// 删除订单
router.delete('/:id', auth, orderCtrl.deleteOrder);

// 批量删除订单
router.delete('/batch/delete', auth, orderCtrl.batchDeleteOrders);

// 获取订单统计
router.get('/stats', auth, orderCtrl.getOrderStats);

module.exports = router; 